/*
 * @Author: liangliang
 * @Date: 2023-05-18 15:40:29
 * @LastEditors: yusha
 * @LastEditTime: 2023-08-25 10:14:43
 * @Description: 线上bug登记
 */

import React, { useState, createContext } from 'react';
import { useAntdTable } from 'ahooks';
import dayjs from 'dayjs';
import {
    Button,
    Form,
    Input,
    Row,
    message,
    Space,
    DatePicker,
    Table,
    Modal,
    Select,
    Col,
} from 'antd';
import type { ColumnsType } from 'antd/es/table';
import { Link } from 'react-router-dom';
import { useFormModal } from '@/hooks/useFormModal';
import {
    demandReportAdd,
    demandReportEdit,
    demandReportQryPage,
    publishPlanAdd,
} from '@/config/request/manage';

import EditSupplierInfo from './module/EditSupplierInfo/index';
import EditPublishPlan from './module/PublishPlanEdit';
import './index.scss';

const SupplierList: React.FC = () => {
    const [form] = Form.useForm();
    const formModalSupplierInfo = useFormModal();
    const formEditPublishPlan = useFormModal();
    const [rowItem, setRowItem] = useState<any>();
    const [isEditInfo, setIsEditInfo] = useState(false);
    const [modal, contextHolder] = Modal.useModal();
    const [isCommit, setIsCommit] = useState(false);

    const ReachableContext = createContext<string | null>(null);
    const UnreachableContext = createContext<string | null>(null);

    const { tableProps, search } = useAntdTable(
        async ({ pageSize, current: pageNum }) => {
            const { publishDate, updateTime } = form.getFieldsValue();
            const params = {
                ...form.getFieldsValue(),
                startTime: publishDate?.[0]?.format('YYYY-MM-DD 00:00:00'),
                endTime: publishDate?.[1]?.format('YYYY-MM-DD 23:59:59'),
                updateStartTime: updateTime?.[0]?.format('YYYY-MM-DD 00:00:00'),
                updateEndTime: updateTime?.[1]?.format('YYYY-MM-DD 23:59:59'),
                pageNum,
                pageSize,
                // supplierType
            };
            delete params.publishDate;
            delete params.updateTime;
            const res = await demandReportQryPage(params);
            return {
                total: res.data.data?.total ?? 0,
                list: res.data.data?.list ?? [],
            };
        },
        { defaultPageSize: 10, form }
    );

    const handleClick = () => {
        window.open('https://dashboard.sniffgroup.com/link/7xNcBgtz', '_blank');
    };

    const columns: ColumnsType<any> = [
        {
            title: '需求类型',
            dataIndex: 'demandType',
            key: 'demandType',
            fixed: 'left',
            width: 8,
            // render: (text) => <span>{['P0', 'P1', 'P2', 'P3', 'P4', 'P5'][text]}</span>,
        },
        {
            title: <span style={{}}>需求名称</span>,
            dataIndex: 'demandName',
            key: 'demandName',
            fixed: 'left',
            width: 20,
            // render: (text) => <span>{['', '技术自查', '业务反馈', '数据监控', '自动化跑出', '其它'][text]}</span>,
        },
        {
            title: '需求状态',
            dataIndex: 'demandStatus',
            key: 'demandStatus',
            width: 8,
            render: (text: string) => {
                if (text === '已暂停') {
                    return <span style={{ color: 'red' }}>{[text]}</span>;
                }
                if (text === '已上线') {
                    return <span style={{ color: 'green' }}>{[text]}</span>;
                }
                if (text === '测试中') {
                    return <span style={{ color: 'blue' }}>{[text]}</span>;
                }
                if (text === '待评审') {
                    return <span style={{ color: 'orange' }}>{[text]}</span>;
                }
                if (text === '已评审') {
                    return <span style={{ color: '#ffec00c7' }}>{[text]}</span>;
                }
                if (text === '开发中') {
                    return <span style={{ color: 'grey' }}>{[text]}</span>;
                }
                if (text === '已作废') {
                    return <span style={{ color: 'blue' }}>{[text]}</span>;
                }
                return <span style={{ color: 'black' }}>{text}</span>;
            },
        },
        {
            title: '提测时间',
            dataIndex: 'submitApplicationDate',
            key: 'submitApplicationDate',
            width: 10,
            render: (text) =>
                text === null ? text : dayjs(text).format('YYYY-MM-DD'),
        },
        {
            title: '发布时间',
            dataIndex: 'publishDate',
            key: 'publishDate',
            width: 10,
            render: (text) =>
                text === null ? text : dayjs(text).format('YYYY-MM-DD'),
        },
        {
            title: '测试人员',
            dataIndex: 'demandTest',
            key: 'demandTest',
            width: 8,
        },
        {
            title: '后端开发',
            dataIndex: 'demandBackDevelop',
            key: 'demandBackDevelop',
            width: 8,
        },
        {
            title: '前端开发',
            dataIndex: 'demandFrontDevelop',
            key: 'demandFrontDevelop',
            width: 8,
        },
        {
            title: '需求评审',
            dataIndex: 'demandReviewDate',
            key: 'demandReviewDate',
            width: 10,
            render: (text) =>
                text === null ? text : dayjs(text).format('YYYY-MM-DD'),
        },
        {
            title: '需求PM',
            dataIndex: 'demandPm',
            key: 'demandPm',
            width: 15,
        },
        // {
        //     title: '冒烟通过率',
        //     dataIndex: 'maoyanLink',
        //     key: 'maoyanLink',
        //     width: 10,
        //     render: (text) => <a href="http://192.168.201.66:8375/link/TazrGoCb" target="_blank">点我</a>
        // },
        {
            title: '备注',
            dataIndex: 'remark',
            key: 'remark',
            width: 50,
        },
        {
            title: '是否延期',
            dataIndex: 'isDeferred',
            key: 'isDeferred',
            width: 10,
        },
        {
            title: '操作',
            key: 'action',
            fixed: 'right',
            width: 15,
            render: (_: any, record: any) => {
                return (
                    <Space size="middle" className="flex-col">
                        <Button
                            type="link"
                            size="small"
                            onClick={() => {
                                setRowItem(record);
                                setIsEditInfo(true);
                                formModalSupplierInfo.modal.open();
                            }}
                        >
                            修改
                        </Button>
                        {record.demandStatus != '已上线' ? (
                            <></>
                        ) : (
                            <Button
                                type="link"
                                size="small"
                                onClick={handleClick}
                            >
                                冒烟通过率
                            </Button>
                        )}
                        {record.demandStatus != '测试中' ? (
                            <></>
                        ) : (
                            <Button
                                type="link"
                                size="small"
                                onClick={() => {
                                    setRowItem(record);
                                    setIsEditInfo(true);
                                    formEditPublishPlan.modal.open();
                                }}
                            >
                                去发布
                            </Button>
                        )}
                        {record.demandStatus != '开发中' ? (
                            <></>
                        ) : (
                            <Button
                                type="link"
                                size="small"
                                onClick={async () => {
                                    setRowItem(record);
                                    modal.info({
                                        title: '提测模板信息：',
                                        content: (
                                            <>
                                                <b
                                                    style={{
                                                        color: 'red',
                                                        fontStyle: 'italic',
                                                    }}
                                                >
                                                    备注：提测后，拷贝此模板并修改对应的提测信息，同步到项目群中！！
                                                </b>
                                                <br />
                                                <br />
                                                <b
                                                    style={{
                                                        color: 'red',
                                                        fontStyle: 'inherit',
                                                    }}
                                                >
                                                    钉钉日志：直行便--工作台--日志--选择需求提测通知
                                                    模版
                                                </b>
                                                <br />
                                                <br />
                                                <b
                                                    style={{
                                                        color: 'black',
                                                        fontStyle: 'inherit',
                                                        fontSize: '25px',
                                                    }}
                                                >
                                                    提测邮件内容：
                                                </b>
                                                <br />
                                                <b>需求名称：</b>
                                                <b>【{record.demandType}】</b>
                                                <ReachableContext.Consumer>
                                                    {() =>
                                                        `${record.demandName}`
                                                    }
                                                </ReachableContext.Consumer>
                                                <br />
                                                <b>需求地址：</b>
                                                <br />
                                                <UnreachableContext.Consumer>
                                                    {() => `${record.demoLink}`}
                                                </UnreachableContext.Consumer>
                                                <hr />
                                                {record.demandPm ? (
                                                    <>
                                                        <UnreachableContext.Consumer>
                                                            {() =>
                                                                `PM：${record.demandPm}`
                                                            }
                                                        </UnreachableContext.Consumer>
                                                        <br />
                                                    </>
                                                ) : (
                                                    <></>
                                                )}
                                                {record.demandPd ? (
                                                    <>
                                                        <UnreachableContext.Consumer>
                                                            {() =>
                                                                `产品：${record.demandPd}`
                                                            }
                                                        </UnreachableContext.Consumer>{' '}
                                                        <br />
                                                    </>
                                                ) : (
                                                    <></>
                                                )}
                                                {record.demandFrontDevelop ? (
                                                    <>
                                                        <UnreachableContext.Consumer>
                                                            {() =>
                                                                `前端开发：${record.demandFrontDevelop}`
                                                            }
                                                        </UnreachableContext.Consumer>
                                                        <br />
                                                    </>
                                                ) : (
                                                    <></>
                                                )}
                                                {record.demandBackDevelop ? (
                                                    <>
                                                        <UnreachableContext.Consumer>
                                                            {() =>
                                                                `后端开发：${record.demandBackDevelop}`
                                                            }
                                                        </UnreachableContext.Consumer>
                                                        <br />
                                                    </>
                                                ) : (
                                                    <></>
                                                )}
                                                {record.demandTest ? (
                                                    <UnreachableContext.Consumer>
                                                        {() =>
                                                            `测试：${record.demandTest}`
                                                        }
                                                    </UnreachableContext.Consumer>
                                                ) : (
                                                    <></>
                                                )}
                                                <hr />
                                                <UnreachableContext.Consumer>
                                                    {() => `提测代码：`}
                                                </UnreachableContext.Consumer>
                                                <br />
                                                <b
                                                    style={{
                                                        color: '#0040ff61',
                                                        fontStyle: 'italic',
                                                    }}
                                                >
                                                    **可以截图附上cicd项目信息
                                                </b>
                                                <br />
                                                <UnreachableContext.Consumer>
                                                    {() =>
                                                        `提测内容：${
                                                            record.remark ?? '-'
                                                        }`
                                                    }
                                                </UnreachableContext.Consumer>
                                                <br />
                                                <UnreachableContext.Consumer>
                                                    {() => `冒烟情况：`}
                                                </UnreachableContext.Consumer>
                                                <br />
                                                <b
                                                    style={{
                                                        color: '#0040ff61',
                                                        fontStyle: 'italic',
                                                    }}
                                                >
                                                    **可以截图冒烟执行情况，没有写无
                                                </b>
                                                <br />
                                                <UnreachableContext.Consumer>
                                                    {() => `遗留问题：`}
                                                </UnreachableContext.Consumer>
                                                <br />
                                                <b
                                                    style={{
                                                        color: '#0040ff61',
                                                        fontStyle: 'italic',
                                                    }}
                                                >
                                                    **有遗留问题在这里明确出来，没有写无
                                                </b>
                                                <br />
                                            </>
                                        ),
                                    });
                                }}
                            >
                                提测邮件
                            </Button>
                        )}
                    </Space>
                );
            },
        },
    ];

    // 新增/修改需求信息
    const editSupplierInfo = async () => {
        try {
            console.log(await formModalSupplierInfo.form.getFieldsValue());
            const params = await formModalSupplierInfo.form.validateFields();

            const beeworkProductId = params.beeworkProductName.split('@@')[1];
            console.log(params.beeworkProductName.split('@@')[1]);
            params.beeworkProductName =
                params.beeworkProductName.split('@@')[0];

            params.demandReviewDate = params.demandReviewDate
                ? dayjs(params.demandReviewDate).format('YYYY-MM-DD 00:00:00')
                : '';
            params.technicalProposalDate = params.technicalProposalDate
                ? dayjs(params.technicalProposalDate).format(
                      'YYYY-MM-DD 00:00:00'
                  )
                : '';
            params.technicalProposalDateStart =
                params.technicalProposalDateStart
                    ? dayjs(params.technicalProposalDateStart).format(
                          'YYYY-MM-DD 00:00:00'
                      )
                    : '';
            params.technicalProposalDateEnd = params.technicalProposalDateEnd
                ? dayjs(params.technicalProposalDateEnd).format(
                      'YYYY-MM-DD 00:00:00'
                  )
                : '';
            params.tcWriteDateStart = params.tcWriteDateStart
                ? dayjs(params.tcWriteDateStart).format('YYYY-MM-DD 00:00:00')
                : '';
            params.tcWriteDateDnd = params.tcWriteDateDnd
                ? dayjs(params.tcWriteDateDnd).format('YYYY-MM-DD 00:00:00')
                : '';
            params.tcProposalDate = params.tcProposalDate
                ? dayjs(params.tcProposalDate).format('YYYY-MM-DD 00:00:00')
                : '';
            params.submitApplicationDate = params.submitApplicationDate
                ? dayjs(params.submitApplicationDate).format(
                      'YYYY-MM-DD 00:00:00'
                  )
                : '';
            params.joinDebuggerDateStart = params.joinDebuggerDateStart
                ? dayjs(params.joinDebuggerDateStart).format(
                      'YYYY-MM-DD 00:00:00'
                  )
                : '';
            params.joinDebuggerDateEnd = params.joinDebuggerDateEnd
                ? dayjs(params.joinDebuggerDateEnd).format(
                      'YYYY-MM-DD 00:00:00'
                  )
                : '';
            params.testEnvironmentDateStart = params.testEnvironmentDateStart
                ? dayjs(params.testEnvironmentDateStart).format(
                      'YYYY-MM-DD 00:00:00'
                  )
                : '';
            params.testEnvironmentDateEnd = params.testEnvironmentDateEnd
                ? dayjs(params.testEnvironmentDateEnd).format(
                      'YYYY-MM-DD 00:00:00'
                  )
                : '';
            params.preEnvironmentDateStart = params.preEnvironmentDateStart
                ? dayjs(params.preEnvironmentDateStart).format(
                      'YYYY-MM-DD 00:00:00'
                  )
                : '';
            params.preEnvironmentDateEnd = params.preEnvironmentDateEnd
                ? dayjs(params.preEnvironmentDateEnd).format(
                      'YYYY-MM-DD 00:00:00'
                  )
                : '';
            params.publishDate = params.publishDate
                ? dayjs(params.publishDate).format('YYYY-MM-DD 00:00:00')
                : '';
            params.finalPublishDate = params.finalPublishDate
                ? dayjs(params.finalPublishDate).format('YYYY-MM-DD 00:00:00')
                : '';
            params.smokeDateStart = params.smokeDateStart
                ? dayjs(params.smokeDateStart).format('YYYY-MM-DD 00:00:00')
                : '';
            params.smokeDateEnd = params.smokeDateEnd
                ? dayjs(params.smokeDateEnd).format('YYYY-MM-DD 00:00:00')
                : '';
            params.developDateStart = params.developDateStart
                ? dayjs(params.developDateStart).format('YYYY-MM-DD 00:00:00')
                : '';
            params.developDateEnd = params.developDateEnd
                ? dayjs(params.developDateEnd).format('YYYY-MM-DD 00:00:00')
                : '';
            params.demandPd = Array.isArray(params.demandPd)
                ? params.demandPd.join('、')
                : params.demandPd;
            params.demandBackDevelop = Array.isArray(params.demandBackDevelop)
                ? params.demandBackDevelop.join('、')
                : params.demandBackDevelop;
            params.demandPm = Array.isArray(params.demandPm)
                ? params.demandPm.join('、')
                : params.demandPm;
            params.demandPtm = Array.isArray(params.demandPtm)
                ? params.demandPtm.join('、')
                : params.demandPtm;
            params.demandUi = Array.isArray(params.demandUi)
                ? params.demandUi.join('、')
                : params.demandUi;
            params.demandFrontDevelop = Array.isArray(params.demandFrontDevelop)
                ? params.demandFrontDevelop.join('、')
                : params.demandFrontDevelop;
            params.demandTest = Array.isArray(params.demandTest)
                ? params.demandTest.join('、')
                : params.demandTest;
            params.dataDevelop = Array.isArray(params.dataDevelop)
                ? params.dataDevelop.join('、')
                : params.dataDevelop;
            params.demandOthers = Array.isArray(params.demandOthers)
                ? params.demandOthers.join('、')
                : params.demandOthers;

            // params.demandReviewDate = params.demandReviewDate === null ? '' : dayjs(params.demandReviewDate).format('YYYY-MM-DD 00:00:00');
            // params.technicalProposalDate = params.technicalProposalDate === null ? '' : dayjs(params.technicalProposalDate).format('YYYY-MM-DD 00:00:00');
            // params.tcProposalDate = params.tcProposalDate === null ? '' : dayjs(params.tcProposalDate).format('YYYY-MM-DD 00:00:00');
            // params.submitApplicationDate = params.submitApplicationDate === null ? '' : dayjs(params.submitApplicationDate).format('YYYY-MM-DD 00:00:00');
            // params.joinDebuggerDateStart = params.joinDebuggerDateStart === null ? '' : dayjs(params.joinDebuggerDateStart).format('YYYY-MM-DD 00:00:00');
            // params.joinDebuggerDateEnd = params.joinDebuggerDateEnd === null ? '' : dayjs(params.joinDebuggerDateEnd).format('YYYY-MM-DD 00:00:00');
            // params.testEnvironmentDateStart = params.testEnvironmentDateStart === null ? '' : dayjs(params.testEnvironmentDateStart).format('YYYY-MM-DD 00:00:00');
            // params.testEnvironmentDateEnd = params.testEnvironmentDateEnd === null ? '' : dayjs(params.testEnvironmentDateEnd).format('YYYY-MM-DD 00:00:00');
            // params.preEnvironmentDateStart = params.preEnvironmentDateStart === null ? '' : dayjs(params.preEnvironmentDateStart).format('YYYY-MM-DD 00:00:00');
            // params.preEnvironmentDateEnd = params.preEnvironmentDateEnd === null ? '' : dayjs(params.preEnvironmentDateEnd).format('YYYY-MM-DD 00:00:00');
            // params.publishDate = params.publishDate === null ? '' : dayjs(params.publishDate).format('YYYY-MM-DD 00:00:00');
            const response = isEditInfo
                ? await demandReportEdit({
                      beeworkProductId: beeworkProductId,
                      ...rowItem,
                      ...params,
                  })
                : await demandReportAdd({
                      beeworkProductId: beeworkProductId,
                      ...params,
                  });
            if (response.data.code === 200) {
                message.success('保存成功！');
                formModalSupplierInfo.modal.close();
                search.submit();
            }
        } catch (error: any) {
            // message.error(error);
            console.error('必填项未填：', error);
        }
    };

    const addPublishPlan = async () => {
        setIsCommit(true);
        try {
            const params = await formEditPublishPlan.form.validateFields();

            params.infoTime = params.infoTime
                ? dayjs(params.infoTime).format('YYYY-MM-DD 00:00:00')
                : '';

            const publishPlanParams = {
                demandId: rowItem.demandId,
                demandType: rowItem.demandType,
                ...params,
                serviceName: params.serviceName?.join(','),
            };

            rowItem.demandStatus = '已上线';
            console.log(publishPlanParams);

            const response = await publishPlanAdd(publishPlanParams);
            if (response.data.code === 200) {
                message.success('保存成功！');
                formEditPublishPlan.modal.close();
                search.submit();

                await demandReportEdit({
                    ...rowItem,
                });
            }
        } catch (error: any) {
            console.error('必填项未填：', error);
            setIsCommit(false);
        }
        setIsCommit(false);
    };

    return (
        <div className="bg-white p-2.5">
            <Form form={form} name="supplierList_search">
                <Row>
                    <Col span={6}>
                        <Form.Item label="需求名称" name="demandName">
                            <Input placeholder="请输入" allowClear />
                        </Form.Item>
                    </Col>
                    <Col span={4}>
                        <Form.Item label="类型" name="demandType">
                            <Select
                                placeholder="请选择类型"
                                options={[
                                    { label: '项目', value: '项目' },
                                    { label: '日常迭代', value: '日常迭代' },
                                    { label: '技改', value: '技改' },
                                    { label: '快速需求', value: '快速需求' },
                                    { label: '技术工具', value: '技术工具' },
                                    { label: 'bugfix', value: 'bugfix' },
                                ]}
                            />
                        </Form.Item>
                    </Col>
                    <Col span={4}>
                        <Form.Item label="状态" name="demandStatus">
                            <Select
                                placeholder="请选择类型"
                                options={[
                                    { label: '全部', value: '' },
                                    { label: '测试中', value: '测试中' },
                                    { label: '开发中', value: '开发中' },
                                    { label: '待评审', value: '待评审' },
                                    { label: '已评审', value: '已评审' },
                                    { label: '已暂停', value: '已暂停' },
                                    { label: '已上线', value: '已上线' },
                                    { label: '已作废', value: '已作废' },
                                ]}
                            />
                        </Form.Item>
                    </Col>
                    <Col span={8}>
                        <Form.Item label="发布日期" name="publishDate">
                            <DatePicker.RangePicker
                                placeholder={['开始日期', '结束日期']}
                                style={{ width: '100%' }}
                            />
                        </Form.Item>
                    </Col>
                    <Col span={4}>
                        <Form.Item label="测试人员" name="demandTest">
                            <Input placeholder="请输入" allowClear />
                        </Form.Item>
                    </Col>
                    <Col span={4}>
                        <Form.Item label="后端开发" name="demandBackDevelop">
                            <Input placeholder="请输入" allowClear />
                        </Form.Item>
                    </Col>
                    <Col span={4}>
                        <Form.Item label="前端开发" name="demandFrontDevelop">
                            <Input placeholder="请输入" allowClear />
                        </Form.Item>
                    </Col>
                    <Col span={4}>
                        <Form.Item label="数据开发" name="dataDevelop">
                            <Input placeholder="请输入" allowClear />
                        </Form.Item>
                    </Col>
                    <Col span={8}>
                        <Form.Item label="更新日期" name="updateTime">
                            <DatePicker.RangePicker
                                placeholder={['开始日期', '结束日期']}
                                style={{ width: '100%' }}
                            />
                        </Form.Item>
                    </Col>
                    <Col span={24} style={{ textAlign: 'right' }}>
                        <Form.Item>
                            <Space size="small">
                                <Button
                                    type="primary"
                                    htmlType="submit"
                                    onClick={search.submit}
                                >
                                    搜索
                                </Button>
                                <Button type="primary" onClick={search.reset}>
                                    重置
                                </Button>
                            </Space>
                        </Form.Item>
                    </Col>
                </Row>
                <div style={{ textAlign: 'left', marginBottom: 16 }}>
                    <Button
                        type="primary"
                        className="mt-5 mb-5"
                        onClick={() => {
                            setIsEditInfo(false);
                            setRowItem({});
                            formModalSupplierInfo.modal.open();
                        }}
                    >
                        需求登记
                    </Button>

                    <br />
                    <span className="form-span" style={{ color: 'red' }}>
                        注意:
                        测试参与需求-测试负责登记，测试填写去发布；测试未参与需求-开发完成登记，去发布开发填写，测试检查！！！
                    </span>
                    <br />
                    <span className="form-span">
                        1、需求及时登记，最晚登记时间为需求评审结束，需求状态及时修改，需求中问题记录在备注中。
                    </span>
                    <br />
                    <span className="form-span">
                        2、快速需求名字太长，命名简化=业务域+快速需求+时间，e.g：oem快速需求1030，需求内容放在备注
                    </span>
                    <br />
                </div>

                <Table
                    {...tableProps}
                    bordered
                    columns={columns}
                    pagination={{
                        ...tableProps.pagination,
                        showQuickJumper: true,
                        showTotal: (total) => `总计 ${total} `,
                    }}
                    // showQuickJumper defaultCurrent={2} total={500} onChange={onChange}
                    rowKey="demandId"
                    locale={{ emptyText: '暂无数据' }}
                    scroll={{ x: 'calc(100vw + 1000px)' }}
                />
            </Form>
            <Modal
                width={1200}
                destroyOnClose
                open={formModalSupplierInfo.isOpen}
                onOk={() => editSupplierInfo()}
                onCancel={() => {
                    formModalSupplierInfo.modal.close();
                }}
                title={isEditInfo ? '修改需求信息' : '新增需求'}
                className="supplierInfoModal"
                okText="确定"
                cancelText="取消"
                maskClosable={false}
            >
                <EditSupplierInfo
                    formModal={formModalSupplierInfo}
                    rowItem={rowItem}
                />
            </Modal>
            <Modal
                width={1200}
                destroyOnClose
                open={formEditPublishPlan.isOpen}
                onOk={() => addPublishPlan()}
                onCancel={() => {
                    formEditPublishPlan.modal.close();
                    setIsCommit(false);
                }}
                title="新增发布计划"
                className="publishPlanInfoModal"
                okText="确定"
                confirmLoading={isCommit}
                cancelText="取消"
                maskClosable={false}
            >
                <EditPublishPlan
                    formModal={formEditPublishPlan}
                    rowItem={rowItem}
                />
            </Modal>
            {contextHolder}
        </div>
    );
};

export default SupplierList;
